import {javaInstance} from '@/utils/https.js'

// 用户登录
export const adminInfoApi = (data) => {
    return javaInstance({
        url: '/admin/login',
        method: 'POST',
        data
    })
}


// 根据token获取用户信息
export const tokenInfoApi = (params) => {
    return javaInstance({
        url: '/admin/token',
        method: 'GET',
        params
    })
}


// 用户登录
export const adminRegisterApi = (data,params) => {
    return javaInstance({
        url: '/admin/register',
        method: 'POST',
        data,
        params
    })
}

// 获取admin分页查询
export const adminPageApi = (params,data) => {
    return javaInstance({
        url: '/admin/getAdminPage',
        method: 'POST',
        params,
        data
    })
}

// 根据id删除admin
export const delAdminByIdApi = (params) => {
    return javaInstance({
        url: '/admin/delAdminById',
        method: 'get',
        params
    })
}

// 预览图片
export const getPreViewApi = (data) => {
    return javaInstance({
        url: '/admin/getPreView',
        method: 'POST',
        data
    })
}

// 修改
export const updateAdminApi = (data) => {
    return javaInstance({
        url: '/admin/update',
        method: 'PUT',
        data
    })
}